//
//	GDDevice.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "GDDevice.h"

NSString *const kGDDeviceAddress = @"address";
NSString *const kGDDeviceCentreFever = @"centreFever";
NSString *const kGDDeviceCentreSwitch = @"centreSwitch";
NSString *const kGDDeviceConnectType = @"connectType";
NSString *const kGDDeviceCreateTime = @"createTime";
NSString *const kGDDeviceDeptId = @"deptId";
NSString *const kGDDeviceDeviceAlarmLow = @"deviceAlarmLow";
NSString *const kGDDeviceDeviceAlarmTop = @"deviceAlarmTop";
NSString *const kGDDeviceDeviceCsq = @"deviceCsq";
NSString *const kGDDeviceDeviceName = @"deviceName";
NSString *const kGDDeviceDeviceNumber = @"deviceNumber";
NSString *const kGDDeviceDeviceType = @"deviceType";
NSString *const kGDDeviceHardware = @"hardware";
NSString *const kGDDeviceHighFever = @"highFever";
NSString *const kGDDeviceHighSwitch = @"highSwitch";
NSString *const kGDDeviceIdField = @"id";
NSString *const kGDDeviceIsOpenBuzz = @"isOpenBuzz";
NSString *const kGDDeviceLat = @"lat";
NSString *const kGDDeviceLon = @"lon";
NSString *const kGDDeviceLowFever = @"lowFever";
NSString *const kGDDeviceLowSwitch = @"lowSwitch";
NSString *const kGDDeviceOnlineState = @"onlineState";
NSString *const kGDDeviceProvince = @"province";
NSString *const kGDDeviceRegionId = @"regionId";
NSString *const kGDDeviceRegionIdName = @"regionIdName";
NSString *const kGDDeviceSoftware = @"software";
NSString *const kGDDeviceTtDevicesDto = @"ttDevicesDto";
NSString *const kGDDeviceUpdateTime = @"updateTime";
NSString *const kGDDeviceUserId = @"userId";
NSString *const kGDDeviceUserName = @"userName";

@interface GDDevice ()
@end
@implementation GDDevice




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kGDDeviceAddress] isKindOfClass:[NSNull class]]){
		self.address = dictionary[kGDDeviceAddress];
	}	
	if(![dictionary[kGDDeviceCentreFever] isKindOfClass:[NSNull class]]){
		self.centreFever = [dictionary[kGDDeviceCentreFever] floatValue];
	}

	if(![dictionary[kGDDeviceCentreSwitch] isKindOfClass:[NSNull class]]){
		self.centreSwitch = [dictionary[kGDDeviceCentreSwitch] integerValue];
	}

	if(![dictionary[kGDDeviceConnectType] isKindOfClass:[NSNull class]]){
		self.connectType = [dictionary[kGDDeviceConnectType] integerValue];
	}

	if(![dictionary[kGDDeviceCreateTime] isKindOfClass:[NSNull class]]){
		self.createTime = dictionary[kGDDeviceCreateTime];
	}	
	if(![dictionary[kGDDeviceDeptId] isKindOfClass:[NSNull class]]){
		self.deptId = dictionary[kGDDeviceDeptId];
	}	
	if(![dictionary[kGDDeviceDeviceAlarmLow] isKindOfClass:[NSNull class]]){
		self.deviceAlarmLow = [dictionary[kGDDeviceDeviceAlarmLow] integerValue];
	}

	if(![dictionary[kGDDeviceDeviceAlarmTop] isKindOfClass:[NSNull class]]){
		self.deviceAlarmTop = [dictionary[kGDDeviceDeviceAlarmTop] integerValue];
	}

	if(![dictionary[kGDDeviceDeviceCsq] isKindOfClass:[NSNull class]]){
		self.deviceCsq = dictionary[kGDDeviceDeviceCsq];
	}	
	if(![dictionary[kGDDeviceDeviceName] isKindOfClass:[NSNull class]]){
		self.deviceName = dictionary[kGDDeviceDeviceName];
	}	
	if(![dictionary[kGDDeviceDeviceNumber] isKindOfClass:[NSNull class]]){
		self.deviceNumber = dictionary[kGDDeviceDeviceNumber];
	}	
	if(![dictionary[kGDDeviceDeviceType] isKindOfClass:[NSNull class]]){
		self.deviceType = dictionary[kGDDeviceDeviceType];
	}	
	if(![dictionary[kGDDeviceHardware] isKindOfClass:[NSNull class]]){
		self.hardware = dictionary[kGDDeviceHardware];
	}	
	if(![dictionary[kGDDeviceHighFever] isKindOfClass:[NSNull class]]){
		self.highFever = [dictionary[kGDDeviceHighFever] floatValue];
	}

	if(![dictionary[kGDDeviceHighSwitch] isKindOfClass:[NSNull class]]){
		self.highSwitch = [dictionary[kGDDeviceHighSwitch] integerValue];
	}

	if(![dictionary[kGDDeviceIdField] isKindOfClass:[NSNull class]]){
		self.idField = dictionary[kGDDeviceIdField];
	}	
	if(![dictionary[kGDDeviceIsOpenBuzz] isKindOfClass:[NSNull class]]){
		self.isOpenBuzz = [dictionary[kGDDeviceIsOpenBuzz] integerValue];
	}

	if(![dictionary[kGDDeviceLat] isKindOfClass:[NSNull class]]){
		self.lat = [dictionary[kGDDeviceLat] floatValue];
	}

	if(![dictionary[kGDDeviceLon] isKindOfClass:[NSNull class]]){
		self.lon = [dictionary[kGDDeviceLon] floatValue];
	}

	if(![dictionary[kGDDeviceLowFever] isKindOfClass:[NSNull class]]){
		self.lowFever = [dictionary[kGDDeviceLowFever] floatValue];
	}

	if(![dictionary[kGDDeviceLowSwitch] isKindOfClass:[NSNull class]]){
		self.lowSwitch = [dictionary[kGDDeviceLowSwitch] integerValue];
	}

	if(![dictionary[kGDDeviceOnlineState] isKindOfClass:[NSNull class]]){
		self.onlineState = [dictionary[kGDDeviceOnlineState] integerValue];
	}

	if(![dictionary[kGDDeviceProvince] isKindOfClass:[NSNull class]]){
		self.province = dictionary[kGDDeviceProvince];
	}	
	if(![dictionary[kGDDeviceRegionId] isKindOfClass:[NSNull class]]){
		self.regionId = dictionary[kGDDeviceRegionId];
	}	
	if(![dictionary[kGDDeviceRegionIdName] isKindOfClass:[NSNull class]]){
		self.regionIdName = dictionary[kGDDeviceRegionIdName];
	}	
	if(![dictionary[kGDDeviceSoftware] isKindOfClass:[NSNull class]]){
		self.software = dictionary[kGDDeviceSoftware];
	}	
	if(![dictionary[kGDDeviceTtDevicesDto] isKindOfClass:[NSNull class]]){
		self.ttDevicesDto = [[GDTtDevicesDto alloc] initWithDictionary:dictionary[kGDDeviceTtDevicesDto]];
	}

	if(![dictionary[kGDDeviceUpdateTime] isKindOfClass:[NSNull class]]){
		self.updateTime = dictionary[kGDDeviceUpdateTime];
	}	
	if(![dictionary[kGDDeviceUserId] isKindOfClass:[NSNull class]]){
		self.userId = dictionary[kGDDeviceUserId];
	}	
	if(![dictionary[kGDDeviceUserName] isKindOfClass:[NSNull class]]){
		self.userName = dictionary[kGDDeviceUserName];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.address != nil){
		dictionary[kGDDeviceAddress] = self.address;
	}
	dictionary[kGDDeviceCentreFever] = @(self.centreFever);
	dictionary[kGDDeviceCentreSwitch] = @(self.centreSwitch);
	dictionary[kGDDeviceConnectType] = @(self.connectType);
	if(self.createTime != nil){
		dictionary[kGDDeviceCreateTime] = self.createTime;
	}
	if(self.deptId != nil){
		dictionary[kGDDeviceDeptId] = self.deptId;
	}
	dictionary[kGDDeviceDeviceAlarmLow] = @(self.deviceAlarmLow);
	dictionary[kGDDeviceDeviceAlarmTop] = @(self.deviceAlarmTop);
	if(self.deviceCsq != nil){
		dictionary[kGDDeviceDeviceCsq] = self.deviceCsq;
	}
	if(self.deviceName != nil){
		dictionary[kGDDeviceDeviceName] = self.deviceName;
	}
	if(self.deviceNumber != nil){
		dictionary[kGDDeviceDeviceNumber] = self.deviceNumber;
	}
	if(self.deviceType != nil){
		dictionary[kGDDeviceDeviceType] = self.deviceType;
	}
	if(self.hardware != nil){
		dictionary[kGDDeviceHardware] = self.hardware;
	}
	dictionary[kGDDeviceHighFever] = @(self.highFever);
	dictionary[kGDDeviceHighSwitch] = @(self.highSwitch);
	if(self.idField != nil){
		dictionary[kGDDeviceIdField] = self.idField;
	}
	dictionary[kGDDeviceIsOpenBuzz] = @(self.isOpenBuzz);
	dictionary[kGDDeviceLat] = @(self.lat);
	dictionary[kGDDeviceLon] = @(self.lon);
	dictionary[kGDDeviceLowFever] = @(self.lowFever);
	dictionary[kGDDeviceLowSwitch] = @(self.lowSwitch);
	dictionary[kGDDeviceOnlineState] = @(self.onlineState);
	if(self.province != nil){
		dictionary[kGDDeviceProvince] = self.province;
	}
	if(self.regionId != nil){
		dictionary[kGDDeviceRegionId] = self.regionId;
	}
	if(self.regionIdName != nil){
		dictionary[kGDDeviceRegionIdName] = self.regionIdName;
	}
	if(self.software != nil){
		dictionary[kGDDeviceSoftware] = self.software;
	}
	if(self.ttDevicesDto != nil){
		dictionary[kGDDeviceTtDevicesDto] = [self.ttDevicesDto toDictionary];
	}
	if(self.updateTime != nil){
		dictionary[kGDDeviceUpdateTime] = self.updateTime;
	}
	if(self.userId != nil){
		dictionary[kGDDeviceUserId] = self.userId;
	}
	if(self.userName != nil){
		dictionary[kGDDeviceUserName] = self.userName;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.address != nil){
		[aCoder encodeObject:self.address forKey:kGDDeviceAddress];
	}
	[aCoder encodeObject:@(self.centreFever) forKey:kGDDeviceCentreFever];	[aCoder encodeObject:@(self.centreSwitch) forKey:kGDDeviceCentreSwitch];	[aCoder encodeObject:@(self.connectType) forKey:kGDDeviceConnectType];	if(self.createTime != nil){
		[aCoder encodeObject:self.createTime forKey:kGDDeviceCreateTime];
	}
	if(self.deptId != nil){
		[aCoder encodeObject:self.deptId forKey:kGDDeviceDeptId];
	}
	[aCoder encodeObject:@(self.deviceAlarmLow) forKey:kGDDeviceDeviceAlarmLow];	[aCoder encodeObject:@(self.deviceAlarmTop) forKey:kGDDeviceDeviceAlarmTop];	if(self.deviceCsq != nil){
		[aCoder encodeObject:self.deviceCsq forKey:kGDDeviceDeviceCsq];
	}
	if(self.deviceName != nil){
		[aCoder encodeObject:self.deviceName forKey:kGDDeviceDeviceName];
	}
	if(self.deviceNumber != nil){
		[aCoder encodeObject:self.deviceNumber forKey:kGDDeviceDeviceNumber];
	}
	if(self.deviceType != nil){
		[aCoder encodeObject:self.deviceType forKey:kGDDeviceDeviceType];
	}
	if(self.hardware != nil){
		[aCoder encodeObject:self.hardware forKey:kGDDeviceHardware];
	}
	[aCoder encodeObject:@(self.highFever) forKey:kGDDeviceHighFever];	[aCoder encodeObject:@(self.highSwitch) forKey:kGDDeviceHighSwitch];	if(self.idField != nil){
		[aCoder encodeObject:self.idField forKey:kGDDeviceIdField];
	}
	[aCoder encodeObject:@(self.isOpenBuzz) forKey:kGDDeviceIsOpenBuzz];	[aCoder encodeObject:@(self.lat) forKey:kGDDeviceLat];	[aCoder encodeObject:@(self.lon) forKey:kGDDeviceLon];	[aCoder encodeObject:@(self.lowFever) forKey:kGDDeviceLowFever];	[aCoder encodeObject:@(self.lowSwitch) forKey:kGDDeviceLowSwitch];	[aCoder encodeObject:@(self.onlineState) forKey:kGDDeviceOnlineState];	if(self.province != nil){
		[aCoder encodeObject:self.province forKey:kGDDeviceProvince];
	}
	if(self.regionId != nil){
		[aCoder encodeObject:self.regionId forKey:kGDDeviceRegionId];
	}
	if(self.regionIdName != nil){
		[aCoder encodeObject:self.regionIdName forKey:kGDDeviceRegionIdName];
	}
	if(self.software != nil){
		[aCoder encodeObject:self.software forKey:kGDDeviceSoftware];
	}
	if(self.ttDevicesDto != nil){
		[aCoder encodeObject:self.ttDevicesDto forKey:kGDDeviceTtDevicesDto];
	}
	if(self.updateTime != nil){
		[aCoder encodeObject:self.updateTime forKey:kGDDeviceUpdateTime];
	}
	if(self.userId != nil){
		[aCoder encodeObject:self.userId forKey:kGDDeviceUserId];
	}
	if(self.userName != nil){
		[aCoder encodeObject:self.userName forKey:kGDDeviceUserName];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.address = [aDecoder decodeObjectForKey:kGDDeviceAddress];
	self.centreFever = [[aDecoder decodeObjectForKey:kGDDeviceCentreFever] floatValue];
	self.centreSwitch = [[aDecoder decodeObjectForKey:kGDDeviceCentreSwitch] integerValue];
	self.connectType = [[aDecoder decodeObjectForKey:kGDDeviceConnectType] integerValue];
	self.createTime = [aDecoder decodeObjectForKey:kGDDeviceCreateTime];
	self.deptId = [aDecoder decodeObjectForKey:kGDDeviceDeptId];
	self.deviceAlarmLow = [[aDecoder decodeObjectForKey:kGDDeviceDeviceAlarmLow] integerValue];
	self.deviceAlarmTop = [[aDecoder decodeObjectForKey:kGDDeviceDeviceAlarmTop] integerValue];
	self.deviceCsq = [aDecoder decodeObjectForKey:kGDDeviceDeviceCsq];
	self.deviceName = [aDecoder decodeObjectForKey:kGDDeviceDeviceName];
	self.deviceNumber = [aDecoder decodeObjectForKey:kGDDeviceDeviceNumber];
	self.deviceType = [aDecoder decodeObjectForKey:kGDDeviceDeviceType];
	self.hardware = [aDecoder decodeObjectForKey:kGDDeviceHardware];
	self.highFever = [[aDecoder decodeObjectForKey:kGDDeviceHighFever] floatValue];
	self.highSwitch = [[aDecoder decodeObjectForKey:kGDDeviceHighSwitch] integerValue];
	self.idField = [aDecoder decodeObjectForKey:kGDDeviceIdField];
	self.isOpenBuzz = [[aDecoder decodeObjectForKey:kGDDeviceIsOpenBuzz] integerValue];
	self.lat = [[aDecoder decodeObjectForKey:kGDDeviceLat] floatValue];
	self.lon = [[aDecoder decodeObjectForKey:kGDDeviceLon] floatValue];
	self.lowFever = [[aDecoder decodeObjectForKey:kGDDeviceLowFever] floatValue];
	self.lowSwitch = [[aDecoder decodeObjectForKey:kGDDeviceLowSwitch] integerValue];
	self.onlineState = [[aDecoder decodeObjectForKey:kGDDeviceOnlineState] integerValue];
	self.province = [aDecoder decodeObjectForKey:kGDDeviceProvince];
	self.regionId = [aDecoder decodeObjectForKey:kGDDeviceRegionId];
	self.regionIdName = [aDecoder decodeObjectForKey:kGDDeviceRegionIdName];
	self.software = [aDecoder decodeObjectForKey:kGDDeviceSoftware];
	self.ttDevicesDto = [aDecoder decodeObjectForKey:kGDDeviceTtDevicesDto];
	self.updateTime = [aDecoder decodeObjectForKey:kGDDeviceUpdateTime];
	self.userId = [aDecoder decodeObjectForKey:kGDDeviceUserId];
	self.userName = [aDecoder decodeObjectForKey:kGDDeviceUserName];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	GDDevice *copy = [GDDevice new];

	copy.address = [self.address copy];
	copy.centreFever = self.centreFever;
	copy.centreSwitch = self.centreSwitch;
	copy.connectType = self.connectType;
	copy.createTime = [self.createTime copy];
	copy.deptId = [self.deptId copy];
	copy.deviceAlarmLow = self.deviceAlarmLow;
	copy.deviceAlarmTop = self.deviceAlarmTop;
	copy.deviceCsq = [self.deviceCsq copy];
	copy.deviceName = [self.deviceName copy];
	copy.deviceNumber = [self.deviceNumber copy];
	copy.deviceType = [self.deviceType copy];
	copy.hardware = [self.hardware copy];
	copy.highFever = self.highFever;
	copy.highSwitch = self.highSwitch;
	copy.idField = [self.idField copy];
	copy.isOpenBuzz = self.isOpenBuzz;
	copy.lat = self.lat;
	copy.lon = self.lon;
	copy.lowFever = self.lowFever;
	copy.lowSwitch = self.lowSwitch;
	copy.onlineState = self.onlineState;
	copy.province = [self.province copy];
	copy.regionId = [self.regionId copy];
	copy.regionIdName = [self.regionIdName copy];
	copy.software = [self.software copy];
	copy.ttDevicesDto = [self.ttDevicesDto copy];
	copy.updateTime = [self.updateTime copy];
	copy.userId = [self.userId copy];
	copy.userName = [self.userName copy];

	return copy;
}
@end